<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 子账户模型
 * author : hxq
 * date : 2017-10-26
 */
class Child extends Model
{
    public $timestamps = false;

    protected $table = 'administrator';

    protected $primaryKey = 'administrator_id';

    protected $fillable = [
        'administrator_id', //主键id
        'account', //账号
        'password', //密码
        'shop_id', //商铺id
        'tel', //电话
        'create_time', //创建时间
        'userid', //用户id
        'token', //token
        'last_login_time', //最后登录时间
        'img', //管理员头像
        'img_oss',
    ];

    protected $casts = ['img'];

    public function getImgAttribute($value)
    {
        return \App\Library\HandleFile::handleFilePath($value, $this->img_oss);
    }
}
